#include <iostream>
#include <algorithm>

using namespace std;
const int N = 1010;
int f[N], n;
long long ans, mul = 1, sum;
void dfs(int idx)
{
    for (int i = idx; i < n; ++i)
    {
        sum += f[i];
        mul *= f[i];
        if (sum > mul)
        {
            ++ans;
            dfs(i + 1);
        }
        else if (f[i] == 1)
        {
            dfs(i + 1);
        }
        else
        {
            sum -= f[i];
            mul /= f[i];
            break;
        }
        sum -= f[i];
        mul /= f[i];
        for (; i < n - 1 && f[i] == f[i + 1]; ++i)
        {
            ;
        }
    }
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> f[i];
    }
    sort(f, f + n);
    dfs(0);
    printf("%d", ans);
    return 0;
}